//---------------------------------------------------------------------------
#ifndef CGBoxH
#define CGBoxH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <StdCtrls.hpp>
#include <extdlgs.hpp>
#include "CtrlStd.h"
#include "Messages.h"

#define COL_EDIT_GBOX   clWindow


//---------------------------------------------------------------------------
class PACKAGE_CTRLSTD CGroupBox : public TCustomGroupBox
    {
    private:
        bool        FReadOnly;
        TPicture    *FPicture;
        bool        m_bBordHautTransparent;

    __published:
        __property Align;
        __property Anchors;
        __property AnsiString   Caption             = { read=GetCaption,    write=SetCaption,       default = false     };
        __property TColor       Color               = { read=GetColor,      write=SetColor,         default = clBtnFace };
        __property              DragCursor;
		__property              DragMode;
		__property bool         Enabled             = { read=GetEnabled,    write=SetEnabled,       default = true      };
		__property              Font;
		__property              HelpContext;
		__property              Hint;
		__property              ParentColor;
		__property              ParentFont;
		__property              ParentShowHint;
		__property              PopupMenu;
		__property bool         ReadOnly            = { read=FReadOnly,     write=SetReadOnly,      default = false     };
		__property              ShowHint;
		__property              TabOrder;
		__property              TabStop;
		__property              Visible;
		__property bool         BordHautTransparent = {read = m_bBordHautTransparent, write = SetBordHautTransparent, default = true};

    // Evenements
		__property OnStartDrag;
        __property OnDragDrop;
        __property OnDragOver;
        __property OnEndDrag;
        __property OnKeyDown;
        __property OnKeyPress;
        __property OnKeyUp;
        __property OnEnter;
        __property OnExit;
        __property OnMouseDown;
        __property OnMouseMove;
        __property OnMouseUp;
        __property OnClick;
        __property OnDblClick;

    private:
      typedef TCustomGroupBox inherited;
      HRGN hrgnZoneVisible;
      bool bIsVraimentVisible;

	protected:
        virtual void __fastcall WndProc( TMessage &Message );
        virtual void __fastcall Paint(void);

    private:
        void        __fastcall SetCaption( const AnsiString aCaption        );
        void        __fastcall SetColor(        TColor      CColor          );
        void        __fastcall SetEnabled(      bool        bVisible        );
        void        __fastcall SetReadOnly(     bool        bReadOnly       );
        void        __fastcall SetTransparent(  bool        bTransparent    );
        AnsiString  __fastcall GetCaption() /*const*/;
        TColor      __fastcall GetColor() const;
        bool        __fastcall GetEnabled();
        bool		__fastcall GetTabStop() const;
        void     __fastcall SetBordHautTransparent(bool bBordHautTransparent);

        void        __fastcall DefinirRegionVisible();

	public:
		__fastcall CGroupBox(TComponent* Owner);
   virtual __fastcall ~CGroupBox(void);
	};
//---------------------------------------------------------------------------
#endif
